package g

import (
	"github.com/gin-gonic/gin"
)

type JsonResult struct {
	Message    string      `json:"message"`
	StatusCode int         `json:"statusCode"`
	Data       interface{} `json:"data"`
}

func ErrorJsonResult(err error, context *gin.Context) {
	context.JSON(500, JsonResult{
		Message:    err.Error(),
		StatusCode: 500,
		Data:       nil,
	})
}
